package com.distortiongames.level27.gameobjects
{
	import com.distortiongames.level27.components.CameraComponent;
	import com.distortiongames.level27.components.WorldSpatialComponent;
	import com.pblabs.core.PBGameObject;
	import com.pblabs.input.KeyboardManager;
	import com.pblabs.time.ITicked;
	import com.pblabs.time.TimeManager;
	import flash.ui.Keyboard;
	
	/**
	 * ...
	 * @author Jefferson Wagner
	 */
	public class Player extends PBGameObject
	{
		public var position:WorldSpatialComponent;
		
		public var camera:CameraComponent;
		
		[Inject]
		public var keyboardManager:KeyboardManager;
		
		override public function initialize():void
		{
			
			position = new WorldSpatialComponent();
			camera = new CameraComponent();
			camera.addBinding("position", "@position.vector");
			super.initialize();
		}
		
		//public function onTick():void
		//{
			//var moveRight:Boolean = keyboardManager.isKeyDown(Keyboard.RIGHT);
			//var moveLeft:Boolean = keyboardManager.isKeyDown(Keyboard.LEFT);
			//var moveUp:Boolean = keyboardManager.isKeyDown(Keyboard.UP);
			//var moveDown:Boolean = keyboardManager.isKeyDown(Keyboard.DOWN);
			//
			//if (moveRight || moveLeft || moveUp || moveDown)
			//{
				//position.vector.x += moveRight ? 10 : 0 + moveLeft ? -10 : 0;
				//position.vector.y += moveDown ? 10 : 0 + moveUp ? -10 : 0;
			//}
		//}
		
		override public function destroy():void
		{
			super.destroy();
		}
	
	}

}